﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/PageTemplate.Master" AutoEventWireup="true"
    Codebehind="CreateService.aspx.cs" Inherits="FrameWork.web.Module.ITMS.Service.CreateService" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageBody" runat="server">
    <!--link rel="stylesheet" type="text/css" href="<%=Page.ResolveUrl("~/") %>inc/FineMessBox/css/subModal.css"-->

    <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>inc/FineMessBox/js/common.js"></script>

    <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>inc/FineMessBox/js/subModal.js"></script>

    <script type="text/javascript">
        var xmlhttp;
        function getData(UID)
        {
          //获取用户填写的名称
        
          //创建异步调用对象
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          //将对象状态与事件相关联
          xmlhttp.onreadystatechange=statechange;
          //加载要链接的页面
          xmlhttp.Open("POST","datapage.aspx?UID="+document.getElementById('<%=drpResolvent.ClientID %>').value,true);
          //发送请求
          xmlhttp.Send();
        }
    function statechange()
    {
      //判断异步调用是否已经完成
      if(xmlhttp.readystate==4)
      {
        //判断完成的提示代码是否是OK状态
        if(xmlhttp.status==200)
        {  
           //将返回数据作为参数，传递给填充方法
           FillData(xmlhttp.responseText);
        }
      }
    }
    function FillData(strcity)
    {
        result=strcity.substring(0,strcity.lastIndexOf('\r\n\r\n<!DOCTYPE html '));
        document.getElementById('<%= txtSolution.ClientID %>').value=result;

    }
    </script>

    <FrameWorkWebControls:HeadMenuWebControls ID="HeadMenuWebControls1" runat="server"
        ButtonList-Capacity="4" HeadOPTxt="服务单填写" HeadTitleTxt="我的服务单">
    </FrameWorkWebControls:HeadMenuWebControls>
    <FrameWorkWebControls:TabOptionWebControls ID="TabOptionWebControls1" runat="server">
        <FrameWorkWebControls:TabOptionItem ID="TabOptionItem1" runat="server" Tab_Name="服务单">
            <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                        *服务单编号</td>
                    <td class="table_none" style="height: 25px; width: 10%;">
                        <asp:TextBox ID="txtServDocNo" runat="server" CssClass="text_input" Width="100%"
                            ReadOnly="True"></asp:TextBox></td>
                    <td class="table_body" style="height: 25px; width: 8%;">
                        *报修人工号</td>
                    <td class="table_none" style="height: 25px; width: 10%;">
                        <asp:TextBox ID="txtRepUserNO" runat="server" CssClass="text_input" Width="100%"></asp:TextBox></td>
                    <td class="table_none" colspan="2" style="height: 25px;">
                        <asp:Button ID="btnGetUser" runat="server" CssClass="cbutton" Text="确定" OnClick="btnGetUser_Click" />
                        &nbsp;<input id="btnRepUserNO" class="cbutton" name="buttonselect" onclick="javascript:ShowRepUserSelect();"
                            type="button" value="查询" />
                        <input id="btnRepUserClean" class="cbutton" name="buttonselect" type="button" value="清除"
                            onclick="CleanRepUserSelect();" /></td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                        *报修人姓名</td>
                    <td class="table_none" style="height: 25px; width: 10%;">
                        <asp:TextBox ID="txtRepUserName" runat="server" CssClass="text_input" Width="100%"></asp:TextBox>
                        <asp:TextBox ID="txtRepUserID" runat="server" CssClass="text_input" Style="display: none"
                            title="选择派单人员" Width="120px"></asp:TextBox></td>
                    <td class="table_body" style="height: 25px; width: 8%;">
                        *报修人部门</td>
                    <td class="table_none" style="height: 25px; width: 10%;">
                        <asp:DropDownList ID="drpGroup" runat="server" Width="100%">
                        </asp:DropDownList></td>
                    <td class="table_body" style="height: 25px; width: 8%;">
                        *报修人电话</td>
                    <td class="table_none" style="height: 25px; width: 10%;">
                        <asp:TextBox ID="txtRepUserTel" runat="server" CssClass="text_input" Width="100%"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 30px; width: 8%;">
                        *报修标题</td>
                    <td class="table_none" colspan="3" style="height: 30px">
                        <asp:TextBox CssClass="text_input" ID="txtRepTitle" runat="server" Width="100%"></asp:TextBox></td>
                    <td class="table_none" colspan="2" style="height: 30px">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 125px; width: 8%;">
                        *具体内容</td>
                    <td colspan="3" class="table_none" style="height: 125px">
                        <asp:TextBox ID="txtRepContent" runat="server" CssClass="text_input" Width="100%"
                            Height="114px" TextMode="MultiLine"></asp:TextBox></td>
                    <td class="table_none" colspan="2">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="5" class="table_none" style="height: 25px;">
                        附件
                        <asp:FileUpload ID="U_PhotoUrl" runat="server" contentEditable="false" CssClass="text_input"
                            Width="362px" />
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:CheckBox ID="chkFirstAlloc" runat="server" Text="首次派单" Width="80px" /><asp:TextBox
                            ID="txtFirstUserName" runat="server" CssClass="text_input" title="选择派单人员" Width="120px"
                            ReadOnly="True"></asp:TextBox>
                        <input id="btnFirstSelect" class="cbutton" name="buttonselect" onclick="javascript:ShowUserSelect('<%=txtFirstUserName.ClientID %>','<%=txtFirstUserID.ClientID %>');"
                            type="button" value="查询" />
                        &nbsp;<input id="btnFirstClear" class="cbutton" type="button" value="清除" onclick="cleanUser('<%=txtFirstUserName.ClientID %>','<%=txtFirstUserID.ClientID %>');" />
                        <asp:TextBox ID="txtFirstUserID" runat="server" CssClass="text_input" title="选择派单人员"
                            Width="120px" Style="display: none"></asp:TextBox></td>
                    <td colspan="3" class="table_none" style="height: 25px">
                        通知方式<asp:CheckBox ID="chkFirstUserEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                            ID="chkFirstUserMsg" runat="server" Text="短消息" />&nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:Label ID="Label1" runat="server" Text="指派关注人" Width="80px"></asp:Label><asp:TextBox
                            ID="txtFirstAttName" runat="server" CssClass="text_input" title="指派关注人" Width="120px"
                            ReadOnly="True"></asp:TextBox>
                        <input id="btnFirstAttSelect" class="cbutton" name="buttonAttselect" onclick="javascript:ShowUserSelect('<%=txtFirstAttName.ClientID %>','<%=txtFirstAttID.ClientID %>');"
                            type="button" value="查询" />&nbsp;
                        <input id="btnFirstAttClear" class="cbutton" type="button" value="清除" onclick="cleanUser('<%=txtFirstAttName.ClientID %>','<%=txtFirstAttID.ClientID %>');" />
                        <asp:TextBox ID="txtFirstAttID" runat="server" CssClass="text_input" Style="display: none"
                            title="选择派单人员" Width="120px"></asp:TextBox></td>
                    <td colspan="3" class="table_none" style="height: 25px">
                        通知方式<asp:CheckBox ID="chkFirstAttEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                            ID="chkFirstAttMsg" runat="server" Text="短消息" /></td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:Label ID="Label6" runat="server" Text="通用报修问题" Width="80px"></asp:Label><asp:DropDownList
                            ID="DropDownList1" runat="server" Width="178px">
                        </asp:DropDownList></td>
                    <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:Label ID="Label3" runat="server" Text="故障分类" Width="80px"></asp:Label><asp:DropDownList
                            ID="drpServTrobType" runat="server" Width="178px">
                        </asp:DropDownList></td>
                    <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:Label ID="Label4" runat="server" Text="问题分类" Width="80px"></asp:Label><asp:DropDownList
                            ID="drpServProbType" runat="server" Width="178px">
                        </asp:DropDownList></td>
                    <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:Label ID="Label2" runat="server" Text="通用解决方法" Width="80px" ></asp:Label><asp:DropDownList
                            ID="drpResolvent" runat="server" Width="178px" onchange="getData()">
                        </asp:DropDownList></td>
                    <td colspan="3" class="table_none" style="height: 25px">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 125px; width: 8%;">
                        *解决方案</td>
                    <td class="table_none" colspan="3" style="height: 125px">
                        <asp:TextBox ID="txtSolution" runat="server" CssClass="text_input" Width="100%" Height="114px"
                            TextMode="MultiLine"></asp:TextBox></td>
                    <td class="table_none" colspan="2" style="height: 125px">
                    &nbsp;</tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:CheckBox ID="chkSecAlloc" runat="server" Text="二次派单" Width="80px" onclick="CheckSecond()" /><asp:TextBox
                            ID="txtSecUserName" runat="server" CssClass="text_input" title="选择二次派单人员" Width="120px"
                            ReadOnly="True"></asp:TextBox>&nbsp;
                        <input id="btnSecSelect" class="cbutton" name="buttonSecSelect" onclick="javascript:ShowUserSelect('<%=txtSecUserName.ClientID %>','<%=txtSecUserID.ClientID %>');"
                            type="button" value="查询" />&nbsp;
                        <input id="Button3" class="cbutton" type="button" value="清除" onclick="cleanUser('<%=txtSecUserName.ClientID %>','<%=txtSecUserID.ClientID %>');" />
                        <asp:TextBox ID="txtSecUserID" runat="server" CssClass="text_input" Style="display: none"
                            title="选择派单人员" Width="120px"></asp:TextBox></td>
                    <td colspan="3" class="table_none" style="height: 25px">
                        通知方式:<asp:CheckBox ID="chkSecUserEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                            ID="chkSecUserMsg" runat="server" Text="短消息" /></td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:Label ID="Label5" runat="server" Text="指派关注人" Width="80px"></asp:Label><asp:TextBox
                            ID="txtSecAttUserName" runat="server" CssClass="text_input" title="指派关注人" Width="120px"
                            ReadOnly="True"></asp:TextBox>&nbsp;
                        <input id="btnSecAttSelect" class="cbutton" name="buttonSecAttSelect" onclick="javascript:ShowUserSelect('<%=txtSecAttUserName.ClientID %>','<%=txtSecAttID.ClientID %>');"
                            type="button" value="查询" />&nbsp;
                        <input id="Button5" class="cbutton" type="button" value="清除" onclick="cleanUser('<%=txtSecAttUserName.ClientID %>','<%=txtSecAttID.ClientID %>');" />
                        <asp:TextBox ID="txtSecAttID" runat="server" CssClass="text_input" Style="display: none"
                            title="选择派单人员" Width="120px"></asp:TextBox></td>
                    <td colspan="3" class="table_none" style="height: 25px">
                        通知方式:<asp:CheckBox ID="chkSecAttEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                            ID="chkSecAttMsg" runat="server" Text="短消息" /></td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        硬件更换信息</td>
                    <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                        IP地址更换信息</td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:TextBox ID="txtHardwareInfo" runat="server" CssClass="text_input" Height="114px"
                            TextMode="MultiLine" Width="100%"></asp:TextBox></td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        <asp:TextBox ID="txtIPAddressInfo" runat="server" CssClass="text_input" Height="114px"
                            TextMode="MultiLine" Width="100%"></asp:TextBox></td>
                    <td class="table_none" style="height: 25px; width: 8%;">
                    </td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="2" class="table_none" style="height: 25px;">
                        通知管理员方式:<asp:CheckBox ID="chkHardNoticeEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                            ID="chkHardNoticeMsg" runat="server" Text="短消息" /></td>
                    <td colspan="3" class="table_none" style="height: 25px; width: 47%;">
                        通知管理员方式:<asp:CheckBox ID="chkIPAddrNotifyEmail" runat="server" Text="邮件" Width="80px" /><asp:CheckBox
                            ID="chkIPAddrNotifyMsg" runat="server" Text="短消息" /></td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="5" class="table_none" style="height: 25px">
                        现场处理内容:</td>
                </tr>
                <tr>
                    <td class="table_body" style="height: 25px; width: 8%;">
                    </td>
                    <td colspan="3" class="table_none" style="height: 25px">
                        <asp:TextBox ID="txtContent" runat="server" CssClass="text_input" Height="114px"
                            TextMode="MultiLine" Width="100%"></asp:TextBox></td>
                    <td colspan="2" class="table_none" style="height: 25px">
                </tr>
                <tr id="SubmitTr" runat="server">
                    <td colspan="6" align="right" style="width: 100%">
                        <asp:Button ID="btnSave" runat="server" CssClass="button_bak" Text="问题解决" OnClick="btnSave_Click" />
                        <asp:Button ID="BtnClose" runat="server" CssClass="button_bak" Text="完成" OnClick="BtnClose_Click" />
                        <input id="Reset1" class="button_bak" type="reset" value="重填" /></td>
                </tr>
            </table>
            <asp:Label ID="lblMailServer" runat="server" Text="Label" Visible="False"></asp:Label>
            <asp:Label ID="lblMailUser" runat="server" Text="Label" Visible="False"></asp:Label>
            <asp:Label ID="lblMailPwd" runat="server" Text="Label" Visible="False"></asp:Label>
            <asp:Label ID="lblMailAddr" runat="server" Text="Label" Visible="False"></asp:Label></FrameWorkWebControls:TabOptionItem>
    </FrameWorkWebControls:TabOptionWebControls>

    <script language="javascript">
        
        rnd.today=new Date(); 
        rnd.seed=rnd.today.getTime(); 

        function rnd() { 
　　　　rnd.seed = (rnd.seed*9301+49297) % 233280; 
　　　　    return rnd.seed/(233280.0); 
        }; 

        function rand(number) { 
　　　　    return Math.ceil(rnd()*number); 
　　　　}; 
    
        function AlertMessageBox(file_name)
        {
       
            if (file_name!=undefined){
	            var ShValues = file_name.split('||');
	            if (ShValues[1]!=0)
	            {
	                document.all.<%=this.txtFirstUserName.ClientID %>.value=ShValues[0];
	                document.all.<%=this.txtFirstUserName.ClientID %>.value=ShValues[1];
	            }            
	        }  
        }
        
      //查找人员，传入显示姓名的文本框ID，用户ID文本框，标题
      function ShowUserSelect(txtName,txtID)
      {
         // showPopWin('选择用户','UserSelect.aspx?'+rand(10000000), 400, 400, AlertMessageBox,true,true)
         left=window.parent.document.getElementById('IframeLeft').style.width.replace('px','');
         
         w=document.body.clientWidth/2-200+parseInt(left);
         h=document.body.clientHeight/2+80;
    
        result=window.showModalDialog('../UserSelect.aspx?rnd='+Math.random(),'','dialogwidth:400px;dialogheight:400px;dialogtop:'+h+'px;dialogleft:'+w+'px');
        if(result==null)
        {
            return;
        }
         if(result.indexOf(',')>-1)
         {
            var returnvalues=result.split(',');
           
            document.getElementById(txtName).value=returnvalues[0];
            document.getElementById(txtID).value=returnvalues[1];
            
         }
      }            
      
      //清空USER
      function cleanUser(txtName,txtID)
      {
        document.getElementById(txtName).value='';
        document.getElementById(txtID).value='';
      }
      
      //查找派单人员信息
      function ShowRepUserSelect()
      {
         // showPopWin('选择用户','UserSelect.aspx?'+rand(10000000), 400, 400, AlertMessageBox,true,true)
         left=window.parent.document.getElementById('IframeLeft').style.width.replace('px','');
         
         w=document.body.clientWidth/2-200+parseInt(left);
         h=document.body.clientHeight/2+80;
    
        result=window.showModalDialog('../UserSelect.aspx?rnd='+Math.random(),'','dialogwidth:400px;dialogheight:400px;dialogtop:'+h+'px;dialogleft:'+w+'px');
        if(result==null)
        {
            return;
        }
         if(result.indexOf(',')>-1)
         {
            var returnvalues=result.split(',');
           
            document.getElementById('<%=txtRepUserName.ClientID%>').value=returnvalues[0];
            document.getElementById('<%=txtRepUserID.ClientID%>').value=returnvalues[1];
            document.getElementById('<%=txtRepUserNO.ClientID%>').value=returnvalues[2];
            document.getElementById('<%=drpGroup.ClientID%>').value=returnvalues[3];//GoupID
            document.getElementById('<%=txtRepUserTel.ClientID%>').value=returnvalues[4];
            
         }
      }
      //清空派单人员信息
      function CleanRepUserSelect()
      {
            document.getElementById('<%=txtRepUserName.ClientID%>').value='';
            document.getElementById('<%=txtRepUserID.ClientID%>').value='';
            document.getElementById('<%=txtRepUserNO.ClientID%>').value='';
            document.getElementById('<%=txtRepUserTel.ClientID%>').value='';        
      }
      
      //二次派单选择时选中其他信息
      function CheckSecond()
      {
        if(document.getElementById('<%=chkSecAlloc.ClientID %>').checked)
        {
            document.getElementById('<%=chkSecUserEmail.ClientID %>').checked=true;
            document.getElementById('<%=chkSecUserMsg.ClientID %>').checked=true;
        }
        else
        {
            document.getElementById('<%=chkSecUserEmail.ClientID %>').checked=false;
            document.getElementById('<%=chkSecUserMsg.ClientID %>').checked=false;
        }
      }
    </script>

</asp:Content>
